import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/celery-member/member-cookbook/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getListAll = (params) => {
  return request({
    url: '/api/celery-member/member-cookbook/list-all',
    method: 'get',
    params: {
      ...params,
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/api/celery-member/member-cookbook/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/celery-member/member-cookbook/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const cancel = (ids) => {
  return request({
    url: '/api/celery-member/member-cookbook/cancel',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const goOn = (row) => {
  return request({
    url: '/api/celery-member/member-cookbook/go-on',
    method: 'post',
    data: row
  })
}

export const stop = (row) => {
  return request({
    url: '/api/celery-member/member-cookbook/stop',
    method: 'post',
    data: row
  })
}

export const add = (row) => {
  return request({
    url: '/api/celery-member/member-cookbook/submit',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/celery-member/member-cookbook/submit',
    method: 'post',
    data: row
  })
}

export const submit = (row) => {
  return request({
    url: '/api/celery-member/member-cookbook/submit',
    method: 'post',
    data: row
  })
}

export const general = (date) => {
  return request({
    url: '/api/celery-member/member-cookbook/general',
    method: 'post',
    params: {
      ...date
    }
  })
}

export const generalDate = (date) => {
  return request({
    url: '/api/celery-member/member-cookbook/general-date',
    method: 'post',
    params: {
      date
    }
  })
}

export const complete = (date) => {
  return request({
    url: '/api/celery-member/member-cookbook/complete',
    method: 'post',
    params: {
      date
    },
  })
}

export const staticsDate = (params) => {
  return request({
    url: '/api/celery-member/member-cookbook/statics-date',
    method: 'get',
    params: {
      ...params,
    }
  })
}

export const changeIsGeneralNo = (ids) => {
  return request({
    url: '/api/celery-member/member-cookbook/change-is-general-no',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const preGeneralMemberCookbook = (memberId) => {
  return request({
    url: '/api/celery-member/member-cookbook/pre-general',
    method: 'post',
    params: {
      memberId,
    }
  })
}


export const changeIsGeneralYes = (ids) => {
  return request({
    url: '/api/celery-member/member-cookbook/change-is-general-yes',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const updateReceiver = (memberId, date, telephone, receiver, address) => {
  return request({
    url: '/api/celery-member/member-cookbook/update-receiver',
    method: 'post',
    params: {
      memberId,
      date,
      telephone,
      receiver,
      address
    }
  })
}


